package hyl.base.net.bio;

import java.io.IOException;
import java.net.Socket;

import hyl.base.net.ASocket;
import hyl.core.net.MySocket;
import hyl.core.run.MyRun;

public abstract class BIOSocket extends ASocket {

	MyRun _work;
	boolean b是否退出程序 = false;

	public static boolean send(Socket skt, byte 类型, byte[] 数据包) {
		try {
			BIOData1 dp = new BIOData1();
			dp.i类型 = 类型;
			dp.data = 数据包;
			MySocket.sendBytes(skt, dp.getSendBytes());
			return true;
		} catch (IOException e) {
			try {
				skt.close();
			} catch (IOException e1) {

				e1.printStackTrace();
			}
		}
		return false;
	}

	public static boolean send(Socket skt, BIOData1 dp) {
		try {
			MySocket.sendBytes(skt, dp.getSendBytes());
			return true;
		} catch (IOException e) {
			try {
				skt.close();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
		return false;

	}

}
